import cv2

video = cv2.VideoCapture('蜡笔小新原视频.mp4')
while video.isOpened():
    retval, img = video.read()
    cv2.namedWindow('video', 0)
    cv2.resizeWindow('video', 420, 300)
    if retval == True:
        cv2.imshow('video', img)
    else:
        break
    key = cv2.waitKey(50)
    # 按下ESC退出
    if key == 27:
        break

video.release()
cv2.destroyAllWindows()
